<% layout("/layouts/micro.html",{title:"日记管理"}){ %>
<div class="childrenBody">
	<div class="kit-table">
		<form class="layui-form">
			<div class="kit-table-header">
				<!-- <div class="kit-search-btns">
					<a class="layui-btn layui-btn-normal addlog_btn"><i
						class="layui-icon">&#xe608;</i>新增</a> <a
						class="layui-btn layui-btn-danger layui-btn-normal delAll_btn"><i
						class="layui-icon">&#xe640;</i>批量删除</a>
				</div> -->

				<div class="kit-search-btns">
					<label class="layui-form-label">日期范围：</label>
					<div class="layui-input-inline">
						<input id="beginDate"  name="beginDate"  type="text" readonly="readonly" class="layui-input" />
						<script>
                            layui.use(['laydate'],function(){
                                var laydate = layui.laydate;
                                laydate.render({
                                    elem: '#beginDate',
                                    value:"${log.beginDate,dateFormat='yyyy-MM-dd'}"
                                });
                            });
						</script>
					</div>--
					<div class="layui-input-inline">
						<input id="endDate"  name="endDate"  type="text" readonly="readonly" class="layui-input" />
						<script>
                            layui.use(['laydate'],function(){
                                var laydate = layui.laydate;
                                laydate.render({
                                    elem: '#endDate',
                                    value:"${log.endDate,dateFormat='yyyy-MM-dd'}"
                                });
                            });
						</script>
					</div>
				</div>
				<div class="kit-search-inputs" style="right: 0px">
					<div class="kit-search-keyword">
						<input type="text" class="layui-input" id="keyword" name="keyword"
							   placeholder="用户姓名/操作菜单/URI" />
						<button class="search_btn" type="button">
							<i class="layui-icon">&#xe615;</i>
						</button>
					</div>

				</div>
			</div>
		</form>
		<div class="kit-table-body">
			<table id="logList" lay-filter="logList"></table>
		</div>
	</div>
</div>
<script>
    layui.use(['form','layer','laydate','table','laytpl'],function(){
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            table = layui.table;
        form.render();
        //列表
        var tableIns = table.render({
            elem: '#logList',
            url : '${ctx}/sys/log/listAjax',
            cellMinWidth : 95,
            page : true,
            request: {
                pageName: 'pageNo', //页码的参数名称，默认：page
                limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            height : "full-70",
            limit : 15,
            limits : [10,15,20,25],
            id : "logListTable",
            cols : [[
                /* {type: "checkbox", fixed:"left", width:50}, */
                {field:'title', title: '操作菜单',width:350,templet:'#fileTmpl'},
                {field:'createByName', title: '操作用户',width:150},
                {field:'companyName', title: '所在公司', width:140},
                {field:'officeName', title: '所在部门', width:140},
                {field:'requestUri', title: 'URI',templet: '#switchTpl'},
                {field:'method', title: '提交方式', width:100},
                {field:'remoteAddr', title: '操作者ip', width:180},
                {field:'createDate', title: '操作时间', width:180},
                /* {field:'exception', title: '异常信息'} */
            ]]
        });

        form.render(null, 'kit-search-form');
        $('#kit-search-more').on('click', function() {
            $('.kit-search-mored').toggle();
        });


        //搜索
        $(".search_btn").on("click",function(){
            var endDate= $('#endDate');
            var beginDate = $('#beginDate');
            var keyword = $('#keyword');
            table.reload("logListTable",{
                page: {
                    curr: 1 //重新从第 1 页开始
                },
                where: {
                    endDate : endDate.val(),
                    beginDate : beginDate.val(),
                    keyword : keyword.val(),
                }
            })
        });

    })
</script>
<%}%>